home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / c2man-2.0pl33.lha / c2man-2.0 / pc / Makefile.pc < prev    next >
Encoding:
Makefile  |  1995-01-24  |  5.0 KB  |  183 lines

  1. # NOTE: This file is generated automatically by the `updmake' perl script,
  2. # which processes the Makefile in the main directory and re-pastes this header
  3. # on the top.
  4. #
  5. # Makefile for c2man                                           23 Aug 1993
  6. #
  7. # - for GNU gcc (emx 0.8g kit) under OS/2 2.x or DOS (32-bit)
  8. # - for Microsoft C 6.00 under OS/2 or DOS (16-bit)
  9.  
  10. # To use, enter "{d,n}make -f Makefile.pc" (this makefile depends on its
  11. # name being "Makefile.pc").
  12. #
  13. # tested with dmake 3.8 and GNU make 3.68 under OS/2
  14.  
  15. default:
  16.     @echo "Enter $(MAKE) -f Makefile.pc target                     "
  17.     @echo " where 'target' is chosen from                          " 
  18.     @echo "   msc      OS/2 and DOS exe [Microsoft C 6.00a]        "
  19.     @echo "   emx      OS/2 and DOS 32-bit exe [EMX/gcc]           "
  20.  
  21. emx:  
  22.     $(MAKE) -f Makefile.pc all \
  23.     CC="gcc -O -s" O=".o" \
  24.     CFLAGS="-DOS2 -DMSDOS" \
  25.     OBJS2="popen.o" \
  26.     LDFLAGS="" \
  27.     LIBS="c2man-32.def" \
  28.  
  29. msc: 
  30.     $(MAKE) -f Makefile.pc all \
  31.     CC="cl -nologo -AS" O=".obj" \
  32.     CFLAGS="-D__STDC__ -DOS2" \
  33.     OBJS2="getopt.obj popen.obj" \
  34.     LDFLAGS="-Lp -F 2000" \
  35.     LIBS="setargv.obj c2man.def -link /NOE" \
  36.     BIND="bind c2man.exe /n DOSMAKEPIPE DOSCWAIT"
  37.  
  38. YACC=bison -y
  39. LEX=flex
  40. SED=sed
  41. RM=rm
  42. MV=mv
  43. ECHO=echo
  44. MKDEP=mkdep
  45.  
  46. # where we get installed
  47. bin=/bin
  48.  
  49. mansrc=/etc/man/manl
  50. manext=l
  51.  
  52. # As Larry said, "Grrrr"
  53. SHELL=/bin/sh
  54.  
  55. # To change anything below here, you should really fix updmake to do it.
  56. # DO NOT EDIT ANYTHING BELOW HERE, OR IT WILL BE LOST NEXT TIME updmake IS RUN.
  57.  
  58. OSOURCES =    config.h c2man.h semantic.h symbol.h strconcat.h \
  59.         strappend.h manpage.h enum.h output.h lex.l grammar.y
  60. DCSOURCES =    c2man.c semantic.c string.c symbol.c strconcat.c \
  61.         strappend.c manpage.c enum.c nroff.c texinfo.c latex.c
  62. SOURCES =    $(OSOURCES) $(DCSOURCES)
  63. CSOURCES =    $(DCSOURCES) y.tab.c
  64. OBJECTS =    c2man$O semantic$O string$O symbol$O y.tab$O strconcat$O \
  65.         strappend$O manpage$O enum$O nroff$O texinfo$O latex$O
  66. GENERATED =    c2man example.inc ctype_ex.inc y.tab.c lex.yy.c y.output \
  67.         fixexamp.sed flatten.sed
  68.  
  69.  
  70. all: c2man.exe example.inc ctype_ex.inc flatten.sed
  71.  
  72. install:
  73.     $(CP) c2man $(bin)
  74.     $(SED) -f flatten.sed < c2man.1 > $(mansrc)/c2man.$(manext)
  75.     -mkdir $(privlib)
  76.     -mkdir $(privlib)/eg
  77.     $(CP) eg/*.[chly] $(privlib)/eg
  78.  
  79. uninstall:
  80.     $(RM) -f $(bin)/c2man $(mansrc)/c2man.$(manext)
  81.     $(RM) -f $(privlib)/eg/*
  82.     rmdir $(privlib)/eg
  83.     rmdir $(privlib)
  84.  
  85. c2man.exe: $(OBJECTS)
  86.     $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
  87.     $(BIND)
  88.  
  89. .c$O:
  90.     $(CC) $(CFLAGS) $(WARNFLAGS) -c $<
  91.  
  92. y.tab.c: grammar.y
  93.     @$(ECHO) Expect 54 shift/reduce conflicts.
  94.     $(YACC) grammar.y
  95.  
  96. # don't compile y.tab.c with all warnings; yacc/bison are not up to it.
  97. y.tab$O: y.tab.c lex.yy.c
  98.     $(CC) $(CFLAGS) -c y.tab.c
  99.  
  100. lex.yy.c: lex.l
  101.     $(LEX) -t -n lex.l > $@
  102.     cp $@ lex_yy.c
  103.  
  104. example.inc: c2man.exe example.h fixexamp.sed
  105.     ./c2man -o- example.h | $(SED) -f fixexamp.sed >example.inc
  106.  
  107. ctype_ex.inc: c2man.exe ctype_ex.h fixexamp.sed
  108.     ./c2man -o- -g ctype_ex.h | $(SED) -f fixexamp.sed >ctype_ex.inc
  109.  
  110. fixexamp.sed: fixexamp.in
  111.     $(SED) -e '/^#/d' fixexamp.in > fixexamp.sed
  112.  
  113. flatten.sed: flatten.SH config.sh
  114.     sh flatten.SH
  115.  
  116. Makefile: Makefile.SH config.sh
  117.     sh Makefile.SH
  118.  
  119. config.h: config_h.SH config.sh
  120.     sh config_h.SH
  121.  
  122. TAGS: $(SOURCES)
  123.     etags -t $(SOURCES)
  124.  
  125. clean:
  126.     $(RM) -f *$O *.s *.bak *~ *.log $(GENERATED) core
  127.  
  128. distclean realclean: clean
  129.     $(RM) -f Makefile config.sh mkdep c2man.kit?
  130.  
  131. lint:
  132.     lint -b $(CFLAGS) $(CSOURCES)
  133.  
  134. print:
  135.     cpr $(SOURCES) | lpr -J'c2man'
  136.  
  137. test: c2man.exe
  138.     @echo "Running c2man over the examples..." 1>&2
  139.     @for file in eg/*.[chly]; do ./c2man -v -o- $$file; done
  140.     @echo "Running c2man over its own source code..." 1>&2
  141.     @for file in $(DCSOURCES); do ./c2man -v -o- $$file; done
  142.     @echo "Hmmm, test seemed to go OK." 1>&2
  143.  
  144. depend:
  145.     $(SED) -e '1,/^# DO NOT/!d' < Makefile > Makefile.new
  146.     $(MKDEP) $(DCSOURCES) >> Makefile.new
  147.     - test ! -f y.tab.c -o ! -f lex.yy.c || $(MKDEP) y.tab.c >> Makefile.new
  148.     $(MV) -f Makefile.new Makefile
  149.  
  150. # y.tab.c dependancies updated manually since it won't exist yet when make
  151. # depend is first run.
  152. y.tab$O: c2man.h config.h confmagic.h enum.h manpage.h semantic.h strappend.h\
  153.     strconcat.h symbol.h
  154.  
  155.  
  156. # DO NOT DELETE THIS LINE! make depend DEPENDS ON IT!
  157. c2man$O: c2man.c c2man.h config.h confmagic.h enum.h manpage.h output.h\
  158.     patchlevel.h strappend.h strconcat.h symbol.h
  159.  
  160. semantic$O: c2man.h config.h confmagic.h enum.h manpage.h output.h semantic.c\
  161.     semantic.h strconcat.h symbol.h
  162.  
  163. string$O: c2man.h config.h confmagic.h string.c symbol.h
  164.  
  165. symbol$O: c2man.h config.h confmagic.h symbol.c symbol.h
  166.  
  167. strconcat$O: c2man.h config.h confmagic.h strconcat.c strconcat.h symbol.h
  168.  
  169. strappend$O: c2man.h config.h confmagic.h strappend.c strappend.h symbol.h
  170.  
  171. manpage$O: c2man.h config.h confmagic.h manpage.c manpage.h output.h\
  172.     semantic.h strappend.h strconcat.h symbol.h
  173.  
  174. enum$O: c2man.h config.h confmagic.h enum.c enum.h manpage.h strconcat.h\
  175.     symbol.h
  176.  
  177. nroff$O: c2man.h config.h confmagic.h manpage.h nroff.c output.h symbol.h
  178.  
  179. texinfo$O: c2man.h config.h confmagic.h manpage.h output.h symbol.h texinfo.c
  180.  
  181. latex$O: c2man.h config.h confmagic.h latex.c manpage.h output.h symbol.h
  182.  
  183.